﻿cmake_minimum_required(VERSION 3.0.0)
project(demo VERSION 1.1.0 LANGUAGES C CXX)

file(GLOB_RECURSE header_list ${CMAKE_CURRENT_SOURCE_DIR}/inc/*.h)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/src ALL_SOURCE)


# 添加头文件路径
include_directories(
    ${PROJECT_SOURCE_DIR}/inc
    ${PROJECT_SOURCE_DIR}/../nebulaWeaver/inc
    ${PROJECT_SOURCE_DIR}/../nebulaWeaver/inc/utils
    ${PROJECT_SOURCE_DIR}/../nebulaWeaver/inc/basic
    ${PROJECT_SOURCE_DIR}/../nebulaWeaver/inc/thread
    ${PROJECT_SOURCE_DIR}/../nebulaWeaver/inc/task
    ${PROJECT_SOURCE_DIR}/../nebulaWeaver/inc/queue
    ${PROJECT_SOURCE_DIR}/../nebulaWeaver/inc/Scheduler
    )

add_executable(${PROJECT_NAME}
    ${header_list}
    ${ALL_SOURCE}
    )


#指定链接路径
target_link_directories(${PROJECT_NAME} PRIVATE
    ${PROJECT_SOURCE_DIR}/../nebulaWeaverLib/
    )

target_link_libraries(${PROJECT_NAME} nebulaWeaver)


#add_dependencies(${PROJECT_NAME} ${PROJECT_SOURCE_DIR}/../nebulaWeaverLib/nebulaWeaver)

set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/../bin)

#修改CMAKE默认安装路径
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
    set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "..." FORCE)
endif()

# 定义需要安装的文件
install(TARGETS ${PROJECT_NAME} DESTINATION ${INSTALL_DIR}/bin)


